package com.jianan.mis.data.domain.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the interman table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="interman"
 */

public abstract class BaseInterman  implements Serializable {

	public static String REF = "Interman";
	public static String PROP_NAME = "Name";
	public static String PROP_PHONE = "Phone";
	public static String PROP_BIRTHDAY = "Birthday";
	public static String PROP_ADDRESS = "Address";
	public static String PROP_INTERNAL_ORGANIZATION = "InternalOrganization";
	public static String PROP_ID = "Id";
	public static String PROP_EMPLOYEE = "Employee";


	// constructors
	public BaseInterman () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseInterman (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseInterman (
		java.lang.Integer id,
		java.lang.String name) {

		this.setId(id);
		this.setName(name);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String name;
	private java.util.Date birthday;
	private java.lang.String phone;
	private java.lang.String address;

	// many to one
	private com.jianan.mis.data.domain.InternalOrganization internalOrganization;
	private com.jianan.mis.data.domain.Employee employee;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="native"
     *  column="id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: name
	 */
	public java.lang.String getName () {
		return name;
	}

	/**
	 * Set the value related to the column: name
	 * @param name the name value
	 */
	public void setName (java.lang.String name) {
		this.name = name;
	}



	/**
	 * Return the value associated with the column: birthday
	 */
	public java.util.Date getBirthday () {
		return birthday;
	}

	/**
	 * Set the value related to the column: birthday
	 * @param birthday the birthday value
	 */
	public void setBirthday (java.util.Date birthday) {
		this.birthday = birthday;
	}



	/**
	 * Return the value associated with the column: phone
	 */
	public java.lang.String getPhone () {
		return phone;
	}

	/**
	 * Set the value related to the column: phone
	 * @param phone the phone value
	 */
	public void setPhone (java.lang.String phone) {
		this.phone = phone;
	}



	/**
	 * Return the value associated with the column: address
	 */
	public java.lang.String getAddress () {
		return address;
	}

	/**
	 * Set the value related to the column: address
	 * @param address the address value
	 */
	public void setAddress (java.lang.String address) {
		this.address = address;
	}



	/**
	 * Return the value associated with the column: internal_organization_id
	 */
	public com.jianan.mis.data.domain.InternalOrganization getInternalOrganization () {
		return internalOrganization;
	}

	/**
	 * Set the value related to the column: internal_organization_id
	 * @param internalOrganization the internal_organization_id value
	 */
	public void setInternalOrganization (com.jianan.mis.data.domain.InternalOrganization internalOrganization) {
		this.internalOrganization = internalOrganization;
	}



	/**
	 * Return the value associated with the column: employee_id
	 */
	public com.jianan.mis.data.domain.Employee getEmployee () {
		return employee;
	}

	/**
	 * Set the value related to the column: employee_id
	 * @param employee the employee_id value
	 */
	public void setEmployee (com.jianan.mis.data.domain.Employee employee) {
		this.employee = employee;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.jianan.mis.data.domain.Interman)) return false;
		else {
			com.jianan.mis.data.domain.Interman interman = (com.jianan.mis.data.domain.Interman) obj;
			if (null == this.getId() || null == interman.getId()) return false;
			else return (this.getId().equals(interman.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}